from django.db import models

# Create your models here.
# 用户表
class User(models.Model):

    name = models.CharField(max_length=20)
    password = models.CharField(max_length=100)


# 小说表
class Fiction(models.Model):

    name = models.CharField(max_length=20)

    user = models.ForeignKey(User,on_delete=models.CASCADE)
    create_time = models.DateTimeField(auto_now_add=True)
    img = models.ImageField(upload_to='static/news')
    details = models.CharField(max_length=200)